@import './variables';

*{
    box-sizing: border-box;
    outline: none;
}
html{
    font-size: 13px;
}
body{
    margin: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.2em;
    background: #f1f1f1;
}
a{
    color: #999;
}
p{
    line-height: 1.5em;
}

.w-100{
    width: 100%;
}
.h-100{
    height: 100%;
}
.text-overflow{
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
@each $colorKey ,$color in $colors {
    .text-#{$colorKey}{
        color: $color;
    }
    .bg-#{$colorKey}{
        background-color: $color;
    }
}

//text-align
@each $var in (left,center,right) {
    .text-#{$var}{
        text-align: $var;
    }
}



@each $sizeKey, $size in $font-sizes {
    .fs-#{$sizeKey}{
        font-size: $size * $base-font-size;
    }
}

//flex
.d-flex{
    display: flex;
}
.flex-column{
    flex-direction: column;
}

.flex-wrap{
    flex-wrap: wrap;
}


@each $key ,$val in $flex-jc {
    .jc-#{$key}{
        justify-content: $val;
    }
}



@each $key ,$val in $flex-ai {
    .ai-#{$key}{
        align-items: $val;
    }
}

.flex-1{
    flex:1;
}

@each $typeKey,$type in $spacing-types {

    @each $sizeKey ,$size in $spacing-sizes {
        .#{$typeKey}-#{$sizeKey}{
            #{$type}:$size * $base-spacing-size;
        }
        
    }
    @each $sizeKey ,$size in $spacing-sizes {
        .#{$typeKey}x-#{$sizeKey}{
            #{$type}-left:$size * $base-spacing-size;
            #{$type}-right:$size * $base-spacing-size;
        }
        .#{$typeKey}y-#{$sizeKey}{
            #{$type}-top:$size * $base-spacing-size;
            #{$type}-bottom:$size * $base-spacing-size;
        }
    }
    @each $directionKey,$direction in $spacing-directions {
        @each $sizeKey ,$size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey}{
                #{$type}-#{$direction}:$size * $base-spacing-size;
            }
            
        }
        
    }
}

.btn{
    border: none;
    border-radius: 0.1538rem;
    font-size: map-get($font-sizes , 'sm' ) * $base-font-size;
    padding: .2rem,.6rem;
    &.btn-lg{
        background: map-get($colors,'light');
        border: 1px solid $border-color;
        border-radius: .2rem;
    }
}


.nav{
    display: flex;
    .nav-item{
        border-bottom: 3px solid transparent;
        padding-bottom: 0.1rem;
        &.active{
            color: map-get($colors,'primary');
            border-bottom-color: map-get($colors,'primary');
        }
    }

    &.nav-inverse{
        .nav-item{
             color: map-get($colors,'white');
             &.active{
                border-bottom-color: map-get($colors,'white');
             }
        }
    }
  
}


.sprite{
    background: url('../images/index.png') no-repeat 0 0;
    background-size: 28.8462rem ;
    display:inline-block;
    &.sprite-news{
        width: 1.7692rem;
        height: 1.5385rem;
        background-position: 63.546% 15.517%;
    }
    &.sprite-arrow{
        width: 0.7692rem;
        height: 0.7692rem;
        background-position: 38.577% 52.076%;
    }
}


@each $dir in (top,left,right,bottom) {
    .border-#{$dir}{
        border-#{$dir}:1px solid $border-color;
    }
}